<!--
 * @Description: 
 * @Autor: 商晓彬
 * @Date: 2021-08-19 11:33:09
 * @LastEditors: 商晓彬
 * @LastEditTime: 2022-02-16 15:59:07
-->
<div class="make-bom">
    <div class="m-subheader">
        <div class="row align-items-center">
            <div class="mr-auto col-auto">
                <h3 class="m-subheader__title m-subheader__title--separator">
                    <span>仓库建模</span>
                </h3>
            </div>
        </div>
    </div>
    <div class="m-content">
        <div class="m-portlet m-portlet--mobile">
            <div class="m-portlet__body">
                <div class="p-formgroup-inline">
                    <p-button *ngIf="'Pages.WarehouseModeling.newlyAdded' | permission" label="新增仓库" (onClick)="add()" ></p-button>
                </div>
                <div class="row align-items-center" style="margin-top: 25px;">
                    <div class="primeng-datatable-container">
                        <p-table #dataTable [value]="primengTableHelper.records" (onLazyLoad)="getTableList($event)"
                            rows="{{primengTableHelper.defaultRecordsCountPerPage}}" [paginator]="false" [lazy]="true"
                            [scrollable]="true" ScrollWidth="100%" [responsive]="primengTableHelper.isResponsive"
                            [resizableColumns]="primengTableHelper.resizableColumns">
                            <ng-template pTemplate="header" >
                                <tr>
                                    <th style="width: 100px">操作</th>
                                    <th style="width: 80px;">序号</th>
                                    <th style="width: 150px">仓库编号</th>
                                    <th style="width: 150px">仓库名称</th>
                                    <th style="width: 150px">仓库类型</th>
                                    <th style="width: 150px">是否启用仓库</th>
                                    <th style="width: 150px">备注</th>
                                </tr>
                            </ng-template>
                            <ng-template pTemplate="body" let-record="$implicit" let-rowIndex="rowIndex">
                                <tr>
                                    <td style="width: 100px">
                                        <div class="btn-group dropdown" dropdown container="body">
                                            <button dropdownToggle class="dropdown-toggle btn btn-sm btn-primary">
                                                <i class="fa fa-cog"></i><span class="caret"></span> 操作
                                            </button>
                                            <ul class="dropdown-menu" *dropdownMenu>
                                                <li>
                                                    <a *ngIf="'Pages.WarehouseModeling.Modify' | permission" href="javascript:;" (click)="update(record)">修改</a>
                                                </li>
                                                <li>
                                                    <a *ngIf="'Pages.WarehouseModeling.Delete' | permission" href="javascript:;" (click)="delate(record)">删除</a>
                                                </li>
                                            </ul>
                                        </div>
                                    </td>
                                    <td style="width: 80px;">{{rowIndex+1}}</td>
                                    <td style="width: 150px">{{record.stroeNo}}</td>
                                    <td style="width: 150px">{{record.stroeName}}</td>
                                    <td style="width: 150px">{{record.stroeTypeName}}</td>
                                    <td style="width: 150px">{{record.storeUseName}}</td>
                                    <td style="width: 150px">{{record.remark}}</td>
                                </tr>
                            </ng-template>
                        </p-table>
                        <div class="primeng-paging-container">
                            <p-paginator [rows]="primengTableHelper.defaultRecordsCountPerPage" #paginator
                                (onPageChange)="getTableList($event)"
                                [totalRecords]="primengTableHelper.totalRecordsCount"
                                [rowsPerPageOptions]="primengTableHelper.predefinedRecordsCountPerPage">
                            </p-paginator>
                            <span class="total-records-count">
                                {{'TotalRecordsCount' | localize:primengTableHelper.totalRecordsCount}}
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <app-add-or-eddit #AddOrEdditComponent [editData]="rowdata" [title]="title" (modalSave)="getTableList()"></app-add-or-eddit>
</div>